home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 126-150 / disk_130 / patedit / patedit.doc < prev    next >
Text File  |  1992-05-06  |  6KB  |  112 lines

  1.             Documentation file for PatEdit pattern editor
  2.             written by Don Hyde 1988       
  3.      
  4.      
  5.             Not copyrighted, you may make whatever use you may wish of
  6.      this program and its  accompanying  documentation.  No warranties
  7.      of any kind are made or implied.
  8.      
  9.      
  10.          The purpose of this program is  to  eliminate graph paper and
  11.      guessing from the process of creating  the necessary patterns for
  12.      input to the Amiga SetAfPt  macro  call.  This call sets the area
  13.      fill  pattern  for  the  area  filling  graphics  calls  such  as
  14.      RectFill, AreaDraw, etc.
  15.      
  16.          The  program's  input  is  entirely   through  the  intuition
  17.      interface, with most functions  being  performed  with the mouse.
  18.      To run from cli, type PatEdit.  An icon is also supplied, and the
  19.      program can be run from the Workbench with it.
  20.      
  21.          The large field of white squares on a green background at the
  22.      left is the pattern itself.  Clicking  on the squares inverts the
  23.      individual bits.  Clicking on the  Clear gadget below the pattern
  24.      clears it to all white (zero bits).  Moving the slider beside the
  25.      field changes the vertical size of  the pattern.  Since the Amiga
  26.      functions restrict this  size  to  be  a power of 2, the possible
  27.      sizes are 1, 2, 4, 8, 16, or 32 bits high.  I'm not sure what the
  28.      actual maximum value allowed by the Amiga functions is, but 32 is
  29.      all that would fit on  the  screen  and  make the squares easy to
  30.      click on.  When you move  the  slider,  the  program  selects the
  31.      nearest allowed value.
  32.      
  33.          The large rectangular area on  the  right  shows you what the
  34.      pattern will look like on a  large  area of the screen.  When the
  35.      program starts, this area will  be  black  because it starts with
  36.      black ink in both pens.   Below  the  example  area are two color
  37.      palettes, one for each of the two Amiga pens.  Clicking the mouse
  38.      on the color palettes changes the  color of its pen.  The example
  39.      area will reflect  these  choices.   In  a program you would call
  40.      SetAPen and SetBPen to set pen 1 and 2 respectively.
  41.      
  42.           Pressing the right mouse button reveals  a Project menu with
  43.      the menuitems Load, Save, About, and Quit.
  44.      
  45.           Load and Save bring up Charlie Heath's file requester, which 
  46.      will display files having the  extension  .pat,  which is used by
  47.      the program to designate  its  data  files.   Load,  as you might
  48.      expect loads one of these small files.  Save saves the pattern in
  49.      a file  called  <filename>.pat.    It  also  creates a file named
  50.      <filename>.h, which contains C  code  for the data which you will
  51.      need to pass to SetAfPt, SetAPen, and SetBPen in order to use the
  52.      patterns.  You will also need to call  SetDrMd(rp, JAM2) in order
  53.      to make patterns like the ones on the screen.  Other arguments to
  54.      SetDrMd can cause some  interesting  effects, and you may want to
  55.      experiment with them.
  56.      
  57.           About briefly describes the program.
  58.      
  59.           Quit, makes the program go away.
  60.      
  61.          The screen, window, menus,  and  Gadgets  were  created  with
  62.      PowerWindows2, which I highly recommend  to anyone who intends to
  63.      create programs for the  Intuition  environment.  With PW2, it is
  64.      not only possible, but  easy  and  convenient  to create programs
  65.      like this one.  Including some learning  of PW2, which I had just
  66.      upgraded from the  earlier  version,  it  took me two days to get
  67.      this tool up and debugged.  I have included the PW2 internal form
  68.      file PatEdit.pw for anyone who is  interested in modifications to
  69.      the program.  The program was compiled with Manx c 3.40B.  I have
  70.      included a makefile.  If you do not have make, you should be able
  71.      to figure out how to link and load it from the makefile.
  72.      
  73.           I have not included  source  code  for  Charlie Heath's file
  74.      requester, since his message asks  that it be distributed only in
  75.      archive form, and without  modifications.   I think that modified
  76.      object is ok, so I have included that.    As supplied it will not
  77.      operate  on  a   low-resolution   screen,   so  it  needs  slight
  78.      modifications to work here, and I  have added a filter so that it
  79.      displays only .pat files.  It  is  widely available in the public
  80.      domain, so I trust you will  be  able  to  find it if you need to
  81.      modify it.  The needed changes are:
  82.      
  83.           In the static struct NewWindow  NewFiles,  the first number,
  84.      which defines the left margin  of  the window, must be changed to
  85.      0, since the width of  the  window  is  320, and that is the full
  86.      width of a  low-resolution  screen.   This  change is adequate to
  87.      make the program run.
  88.      
  89.           After the comment /*  Here  you  can  add  a  file/directory
  90.      filter */, after the next line of code which begins p_D->isfile =
  91.      ..., add the lines:
  92.      
  93.      /* .pat filter */
  94.      if (p_D->isfile) /* filter only files, not directories */
  95.      { p_mung=index(dir_info->fib_FileName, '.'); /* find . in name */
  96.        if (!p_mung || strcmp(p_mung, ".pat")) return NL;
  97.      }
  98.      
  99.           The line after is:  p_mung = p_D->dE[0];
  100.       
  101.           This second  change  is  the  filter  for  files  with  .pat
  102.      extensions.
  103.      
  104.           I hope you can enjoy the program and  find it useful.  It is
  105.      pretty to look at anyway.
  106.      
  107.           Don Hyde
  108.           6641 Scott St.
  109.           Hollywood, FL 33024
  110.      
  111.           (305)966-8179
  112.